<?xml version="1.0" encoding="utf-8"?>
<openerp>
	<data>
	
	<report 
        id="action_report_purchase_order"
        model="purchase.order"
        string="Purchase Order"
        report_type="qweb-pdf"
        name="purchase.report_purchaseorder"
        file="purchase.report_purchaseorder"
        groups="applico_v8.hidden_applico"
    />
	
	<report 
        id="report_purchase_quotation"
        model="purchase.order"
        string="Request for Quotation"
        report_type="qweb-pdf"
        name="purchase.report_purchasequotation"
        file="purchase.report_purchasequotation"
        groups="applico_v8.hidden_applico"
    />
	
	<report 
       id="action_report_purchase_order"
       model="purchase.order"
       string="Purchase Order Print"
       report_type="qweb-pdf"
       name="batam_fast_module.report_invoice2"
       file="batam_fast_module.report_invoice2"
    />
	
	<record id="action_report_purchase_order" model="ir.actions.report.xml">
        <field name="paperformat_id" ref="batam_fast_module.paperformat_ami"/>
    </record>
	
<!--Purchase Inherit-->

		<record id="purchase_order_form_bf" model="ir.ui.view">
			<field name="name">purchase.order.form.bf</field>
			<field name="model">purchase.order</field>
			<field name="inherit_id" ref="purchase.purchase_order_form"/>
			<field name="arch" type="xml">
				<button name="print_quotation" position="replace">
					<button name="print_quotation" string="Print RFQ" type="object" states="draft" class="oe_highlight" groups="base.group_user" invisible="1"/>
					<button name="print_quotation" string="Re-Print RFQ" type="object" states="sent" groups="base.group_user" invisible="1"/>
				</button>
				<button id="draft_confirm" position="replace">
					<button name="purchase_confirm" states="draft" string="Confirm Order" id="draft_confirm" groups="batam_fast_module.group_purchase_supervisor"/>
				</button>
				<field name="location_id" position="after">
					<field name="send_po"/>
				</field>
				<button name="purchase_approve" position="replace">
					<button name="purchase_approve" states="confirmed" string="Approve Order" class="oe_highlight" groups="batam_fast_module.group_purchase_ceo,batam_fast_module.group_purchase_financial_m"/>
				</button>
				<button name="wkf_send_rfq" states="draft" position="replace">
					<button name="wkf_send_rfq" invisible="1" states="draft" string="Send RFQ by Email" type="object" context="{'send_rfq':True}" class="oe_highlight"/>
					<button name="test_message_ceo" string="Send PO" type="object" attrs="{'invisible': ['|',('state','!=', 'approved'), ('send_po','=', True)]}"/>
					<button name="test_message_ceo" string="Un-Send PO" type="object" attrs="{'invisible': ['|',('state','!=', 'approved'), ('send_po','=', False)]}"/>
				</button>
				<field name="validator" position="before">
					<field name="ceo_id" required="1" on_change="onchange_ceo_id(ceo_id, context)" widget="selection"/>
					<field name="financial_manager_id" on_change="onchange_financial_id(financial_manager_id, context)" widget="selection" required="1"/>
				</field>
				<button name="print_quotation" position="after">
					<button name="po_print2" string="Print" type="object"/>
				</button>		
			</field>
		</record>

		<record id="purchase_order_form_applico_bf" model="ir.ui.view">
			<field name="name">purchase.order.form.applico.bf</field>
			<field name="model">purchase.order</field>
			<field name="inherit_id" ref="applico_v8.purchase_order_form_applico"/>
			<field name="arch" type="xml">
				<page string="Other Setup" position="before">
					<page string="Terms &amp; Conditions">
						<field name="remark"/>
					</page>
				</page>
				<page string="Other Setup" position="replace">
					<page string="Other Setup" groups="batam_fast_module.group_purchase_ceo">
						<group>
							<button type="action"
	                            name="%(applico_v8.act_add_lines_po)d"
	                            class="oe_stat_button"
	                            icon="fa-sign-in"
	                            string="Add PO Line" states="confirmed,approved">
	                        </button>
						</group>
					</page>
				</page>
			</field>
		</record>
	</data>
</openerp>


